home *** CD-ROM | disk | FTP | other *** search
/ SIGGRAPH 2002 Course Notes / SIGGRAPH 2002 - Course Notes - Disc 1.iso / pc / notes / 07 / Authoring / worlds / vrml-x3d.wrl < prev    next >
Encoding:
Text File  |  2002-04-08  |  6.9 KB  |  239 lines

  1. #VRML V2.0 utf8
  2.  
  3.  
  4.  
  5. EXTERNPROTO Toss [
  6.   field MFNode objectShape
  7.   exposedField SFTime cycleInterval
  8.   exposedField SFTime startTime
  9.   exposedField SFTime stopTime
  10.   exposedField SFBool enabled
  11.   exposedField SFBool loop
  12.   exposedField MFFloat key
  13.   exposedField MFVec3f keyValue
  14. ] "Toss.wrl"
  15.  
  16.  
  17. Background {
  18.   leftUrl [
  19. #   "urn:web3d:media:textures/panoramas/horizon_5_left.jpg"
  20.    "http://www.web3d.org/WorkingGroups/media/textures/panoramas/horizon_5_left.jpg"
  21.    "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/horizon_5_left.jpg"
  22.    "http://www.officetowers.com/UniversalMedia/textures/panoramas/horizon_5_left.jpg"
  23.    "http://geometrek.com/UniversalMedia/textures/panoramas/horizon_5_left.jpg"
  24.    "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/horizon_5_left.jpg"
  25.   ]
  26.   rightUrl [
  27. #   "urn:web3d:media:textures/panoramas/horizon_5_right.jpg"
  28.    "http://www.web3d.org/WorkingGroups/media/textures/panoramas/horizon_5_right.jpg"
  29.    "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/horizon_5_right.jpg"
  30.    "http://www.officetowers.com/UniversalMedia/textures/panoramas/horizon_5_right.jpg"
  31.    "http://geometrek.com/UniversalMedia/textures/panoramas/horizon_5_right.jpg"
  32.    "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/horizon_5_right.jpg"
  33.   ]
  34.   frontUrl [
  35. #   "urn:web3d:media:textures/panoramas/horizon_5_front.jpg"
  36.    "http://www.web3d.org/WorkingGroups/media/textures/panoramas/horizon_5_front.jpg"
  37.    "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/horizon_5_front.jpg"
  38.    "http://www.officetowers.com/UniversalMedia/textures/panoramas/horizon_5_front.jpg"
  39.    "http://geometrek.com/UniversalMedia/textures/panoramas/horizon_5_front.jpg"
  40.    "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/horizon_5_front.jpg"
  41.   ]
  42.   backUrl [
  43. #   "urn:web3d:media:textures/panoramas/horizon_5_back.jpg"
  44.    "http://www.web3d.org/WorkingGroups/media/textures/panoramas/horizon_5_back.jpg"
  45.    "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/horizon_5_back.jpg"
  46.    "http://www.officetowers.com/UniversalMedia/textures/panoramas/horizon_5_back.jpg"
  47.    "http://geometrek.com/UniversalMedia/textures/panoramas/horizon_5_back.jpg"
  48.    "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/horizon_5_back.jpg"
  49.   ]
  50.   topUrl [
  51. #   "urn:web3d:media:textures/panoramas/horizon_5_top.jpg"
  52.    "http://www.web3d.org/WorkingGroups/media/textures/panoramas/horizon_5_top.jpg"
  53.    "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/horizon_5_top.jpg"
  54.    "http://www.officetowers.com/UniversalMedia/textures/panoramas/horizon_5_top.jpg"
  55.    "http://geometrek.com/UniversalMedia/textures/panoramas/horizon_5_top.jpg"
  56.    "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/horizon_5_top.jpg"
  57.   ]
  58.   bottomUrl [
  59. #   "urn:web3d:media:textures/panoramas/horizon_5_bottom.jpg"
  60.    "http://www.web3d.org/WorkingGroups/media/textures/panoramas/horizon_5_bottom.jpg"
  61.    "http://www.web3dmedia.com/UniversalMedia/textures/panoramas/horizon_5_bottom.jpg"
  62.    "http://www.officetowers.com/UniversalMedia/textures/panoramas/horizon_5_bottom.jpg"
  63.    "http://geometrek.com/UniversalMedia/textures/panoramas/horizon_5_bottom.jpg"
  64.    "http://www.sc.ehu.es/ccwgamoa/UniversalMedia/textures/panoramas/horizon_5_bottom.jpg"
  65.   ]
  66. }
  67.  
  68.  
  69. DEF VP Viewpoint {
  70.   description "Watcher"
  71.   position 1 1 7
  72. }
  73.  
  74.  
  75. # Insert VRML name
  76.  
  77. DEF VRML Transform {
  78.   children [
  79.     DEF Touch TouchSensor {}
  80.     Inline {url "vrml-logoOnly.wrl"}
  81.   ]
  82. }
  83.  
  84.  
  85. # Insert X3D name (out of visibile way)
  86.  
  87. DEF X3D Transform {
  88.   translation 0 6 0
  89.   scale .4 .4 .4
  90.   children Transform {
  91.     translation 0 1 0
  92.     children Inline {
  93.       url "x3d-logoOnly.wrl"
  94.     }
  95.   }
  96. }
  97.  
  98.  
  99. # Insert the moving shapes
  100.  
  101. Transform {
  102.   translation 3.5 0 0
  103.   children [
  104.     Toss {
  105.       objectShape [
  106.         Transform {
  107.           translation -1 0 0
  108.           rotation .71 0 .71 .5
  109.           children [
  110.             Shape {
  111.               appearance Appearance {
  112.                 material Material {
  113.                   diffuseColor 1 0 0
  114.                 }
  115.               }
  116.               geometry Box {
  117.                 size .7 .7 .7
  118.               }
  119.             }
  120.           ]
  121.         }
  122.       ]
  123.       cycleInterval 3
  124.       enabled TRUE
  125.       loop TRUE
  126.       startTime 1
  127.     }
  128.  
  129.  
  130.     Toss {
  131.       objectShape [
  132.         Transform {
  133.           translation .2 .2 0
  134.           children [
  135.             Shape {
  136.               appearance Appearance {
  137.                 material Material {
  138.                   diffuseColor 0 .8 0
  139.                 }
  140.               }
  141.               geometry Sphere {
  142.                 radius .4
  143.               }
  144.             }
  145.           ]
  146.         }
  147.       ]
  148.       cycleInterval 5
  149.       enabled TRUE
  150.       loop TRUE
  151.       startTime 1
  152.     }
  153.  
  154.     Toss {
  155.       objectShape [
  156.         Transform {
  157.           translation 1 0 0
  158.           rotation .71 0 .71 -.40
  159.           children [
  160.             Shape {
  161.               appearance Appearance {
  162.                 material Material {
  163.                   diffuseColor 0 0 1
  164.                 }
  165.               }
  166.               geometry Cone {
  167.                 bottomRadius .4
  168.                 height .7
  169.               }
  170.             }
  171.           ]
  172.         }
  173.       ]
  174.       cycleInterval 4
  175.       enabled TRUE
  176.       loop TRUE
  177.       startTime 1
  178.     }
  179.   ]
  180. }
  181.  
  182.  
  183. DEF Timer TimeSensor {
  184.   cycleInterval 3.5
  185.   startTime 0
  186.   stopTime 0
  187.   loop FALSE
  188.   enabled TRUE
  189. }
  190. DEF X3D_Mover PositionInterpolator {
  191.   key [0 .22 .45 .53 .62 .71 .79 .85 .9 .95 1]
  192.   keyValue [0 6 0, 0 3.5 0, 0 1 0, 0 2.25 0, 0 3.5 0, 0 2.25 0, 0 .75 0, 0 1.5 0, 0 2.2 0, 0 1.5 0, 0 .5 0]
  193. }
  194. DEF X3D_Spiner OrientationInterpolator {
  195.   key [0 .45 .79 1]
  196.   keyValue [0 1 0 -.5, 0 1 0 .5, 0 1 0 -.25, 0 1 0 0]
  197. }
  198. DEF VRML_Mover PositionInterpolator {
  199.   key [0 .45 .47 .79 .81 .98 1]
  200.   keyValue [0 0 0, 0 0 0, 0 -.1 0, 0 -.1 0, 0 -.25 0, 0 -.25 0, 0 -.5 0]
  201. }
  202. DEF VRML_Scaler PositionInterpolator {
  203.   key [0 .45 .47 .79 .81 .98 1]
  204.   keyValue [1 1 1, 1 1 1, 1 .95 1, 1 .95 1, 1 .88 1, 1 .88 1, 1 .75 1]
  205. }
  206.  
  207.  
  208. ROUTE Touch.touchTime TO Timer.startTime
  209. ROUTE Timer.fraction_changed TO X3D_Mover.set_fraction
  210. ROUTE Timer.fraction_changed TO X3D_Spiner.set_fraction
  211. ROUTE Timer.fraction_changed TO VRML_Mover.set_fraction
  212. ROUTE Timer.fraction_changed TO VRML_Scaler.set_fraction
  213. ROUTE X3D_Mover.value_changed TO X3D.translation
  214. ROUTE VRML_Mover.value_changed TO VRML.translation
  215. ROUTE VRML_Scaler.value_changed TO VRML.scale
  216. ROUTE X3D_Spiner.value_changed TO X3D.rotation
  217.  
  218.  
  219. DEF TimerVP TimeSensor {
  220.   cycleInterval 4.5
  221.   startTime 0
  222.   stopTime 0
  223.   loop FALSE
  224.   enabled TRUE
  225. }
  226. DEF VP_Orientation OrientationInterpolator {
  227.   key [0 .7 1]
  228.   keyValue [0 1 0 0, 0 1 0 0, 0, -1, 0, 0.25]
  229. }
  230. DEF VP_Position PositionInterpolator {
  231.   key [0 .7 1]
  232.   keyValue [1 1 7, 1 1 7, -0.79 1 7.027]
  233. }
  234. ROUTE Touch.touchTime TO TimerVP.startTime
  235. ROUTE TimerVP.fraction_changed TO VP_Orientation.set_fraction
  236. ROUTE TimerVP.fraction_changed TO VP_Position.set_fraction
  237. ROUTE VP_Orientation.value_changed TO VP.orientation
  238. ROUTE VP_Position.value_changed TO VP.position
  239.